package com.why.blog.common;

import lombok.Data;


@Data
public class BusinessRuntimeException extends RuntimeException {
	/**
	 * 结果码
	 */
	private String code;

	/**
	 * 结果码描述
	 */
	private String msg;

	/**
	 * 结果码枚举
	 */
	private ResponseCode responseCode;
	
	public BusinessRuntimeException(ResponseCode responseCode, String msg) {
		super(msg == null ? responseCode.getMsg() : msg);
		this.code = responseCode.getCode();
		this.msg = responseCode.getMsg();
		this.responseCode = responseCode;
	}
}
